home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mint96sb.zoo / src / purec / makefile.pcc < prev    next >
Encoding:
Makefile  |  1992-10-19  |  4.4 KB  |  169 lines

  1. #
  2. # Makefile for MiNT using the Pure CC
  3. #
  4.  
  5. # if you're cross-compiling, define NATIVECC
  6. # to the host's C compiler, NATIVECFLAGS to
  7. # the appropriate flags for it, and NATIVELIBS
  8. # to appropriate libraries
  9. # NATIVECC = cc
  10. # NATIVECFLAGS = -g
  11. # NATIVELIBS =
  12.  
  13. NATIVECC = gcc
  14. NATIVECFLAGS = -O
  15. NATIVELIBS = -liio
  16.  
  17. #
  18. # depending on your version of bison/yacc, you may
  19. # need to change these names, e.g. to
  20. # YACC = yacc
  21. # YTABC = y.tab.c
  22. # YTABH = y.tab.h
  23.  
  24. YACC = bison -d
  25. YTABC = asm,tab.c
  26. YTABH = asm,tab.h
  27.  
  28. # here are defs for the cross compiler
  29. # MiNT must be compiled with 16 bit integers
  30.  
  31. CC = cc -g
  32. AS = cc -Wa,-2 -Wa,-8 -Wa,-S -c
  33. #MODEL = -mshort -m68020
  34. LIBS = -lpctoslib.lib
  35.  
  36. # add -DEZMINT for smaller MiNT
  37. DEFS = -DFASTTEXT -DOWN_LIB
  38.  
  39. # if you have an older version of gcc, it won't understand -G;
  40. # that won't hurt anything (it just controls the format of the
  41. # symbol table) so just delete the -G. Do *not* change it into
  42. # -g!!!
  43. #
  44. CFLAGS =  -D__STDC__ -W0,-P $(MODEL) $(DEFS)
  45.  
  46.  
  47. COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
  48.     filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
  49.     biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
  50.     unifs.o shmfs.o fasttext.o
  51.  
  52. CSRCS = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
  53.     filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
  54.     biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
  55.     unifs.c shmfs.c fasttext.c
  56.  
  57. SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
  58.  
  59. OBJS = $(COBJS) $(SOBJS)
  60.  
  61. mint.prg: $(OBJS)
  62.     $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
  63.  
  64. $(SOBJS): proc.h
  65. $(COBJS): mint.h proc.h file.h
  66.  
  67. main.o: version.h
  68. bios.o: inline.h
  69.  
  70. #
  71. # assembler source files are now handled in a radically different
  72. # fashion. We build a pre-processor program, asmtrans, that
  73. # takes the .spp files, merges them with an include file that
  74. # gives various offsets into structures of interest, and produces
  75. # the .s files as output. This has two major advantages:
  76. # (1) it lets us use the same source for both the Lattice and
  77. #     gcc assembler files (the translator will convert), and
  78. # (2) if we change the CONTEXT or PROC structures, we don't
  79. #     have to dig through the source code looking for
  80. #     magic numbers
  81.  
  82. # the asm translator program
  83. # Note that this must be compiled with the native CC of whatever
  84. # system you're using; see the definitions at the top of this
  85. # file.
  86.  
  87. ATRANSOBJ = asmtab.o trutil.o trans.o
  88. ATRANS = asmtrans.ttp
  89.  
  90. $(ATRANS): $(ATRANSOBJ)
  91.     $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
  92.         $(NATIVELIBS)
  93.  
  94. asmtab.o: asmtab.c asmtrans.h
  95.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
  96.  
  97. trutil.o: trutil.c asmtrans.h
  98.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
  99.  
  100. trans.o: trans.c asmtrans.h
  101.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
  102.  
  103.  
  104. asmtab.c asmtab.h:    asm.y
  105.     $(YACC) asm.y
  106.     mv $(YTABC) asmtab.c
  107.     mv $(YTABH) asmtab.h
  108.  
  109. # the magic number include file is generated automagically
  110. # NOTE that of course, magic.i can only reliably be generated
  111. # on an Atari ST; if you're cross-compiling, you'll have
  112. # to edit magic.i by hand
  113. # for cross compilers; uncomment the following definitions
  114. # and comment out the other ones below
  115.  
  116. # for cross-compiling
  117.  
  118. # GENMAGICPRG=echo
  119. # magic.i: proc.h file.h genmagic.c
  120. #    echo "Warning: magic.i may be out of date"
  121.  
  122. #for native compiling
  123.  
  124. GENMAGICPRG=genmagic.ttp
  125.  
  126. $(GENMAGICPRG): genmagic.c proc.h file.h
  127.     $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
  128.  
  129. magic.i: $(GENMAGICPRG)
  130.     $(GENMAGICPRG) $@
  131.  
  132. #
  133. # assembler source files
  134. #
  135. .SUFFIXES: .spp
  136.  
  137. .spp.s:
  138.     $(ATRANS) -purec -o $@ $<
  139.  
  140. context.o: context.spp magic.i $(ATRANS)
  141. intr.o: intr.spp magic.i $(ATRANS)
  142. syscall.o: syscall.spp magic.i $(ATRANS)
  143. quickzer.o: quickzer.spp $(ATRANS)
  144. quickmov.o: quickmov.spp $(ATRANS)
  145. cpu.o: cpu.spp $(ATRANS)
  146.  
  147. #
  148. # mkptypes generates prototypes from C source code. If you don't have it,
  149. # you'll have to add/delete function prototypes by hand.
  150. # also: Sozobon users will have to edit proto.h by hand to change the
  151. #    #if defined(__STDC__) || defined(__cplusplus)
  152. # line into
  153. #    #if __STDC__
  154. #
  155. proto.h: $(CSRCS)
  156.     mkptypes $(CSRCS) >proto.h
  157.  
  158. #
  159. # macros for cleaning up
  160. #
  161. GENFILES= $(OBJS) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
  162. EXTRAS= asmtab.c asmtab.h mint.prg
  163.  
  164. clean:
  165.     $(RM) $(GENFILES)
  166.  
  167. realclean:
  168.     $(RM) $(GENFILES) $(EXTRAS)
  169.